package com.publishSubscribe;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConcreteObserver extends Observer {

	private static Logger logger = LoggerFactory
			.getLogger(ConcreteObserver.class);
	private String name;
	private String observerState;
	private ConcreteSubject subject;

	@Override
	public void update() {
		observerState = subject.getSubjectState();
		logger.info("观察者{} 的新状态是{}", name, observerState);
	}




	public ConcreteObserver(String name, ConcreteSubject subject) {
		super();
		this.name = name;
		this.subject = subject;
	}




	public ConcreteSubject getSubject() {
		return subject;
	}

	public void setSubject(ConcreteSubject subject) {
		this.subject = subject;
	}
	

}
